package com.hwtx.form.persistence.ds.metadata;

import java.io.Serializable;

public class Schema extends BaseMetadata<Schema> implements Serializable {
    public Schema() {

    }

    public Schema(String name) {
        this.name = name;
    }

    public String toString() {
        return name;
    }

    public boolean isEmpty() {
        return null == name || name.trim().isEmpty();
    }

    public boolean equal(Schema schema) {
        String name = null;
        Catalog catalog = null;
        if (null != schema) {
            name = schema.getName();
            catalog = schema.getCatalog();
        }
        boolean catalog_equal = false;
        if (null == this.catalog) {
            if (null == catalog) {
                catalog_equal = true;
            }
        } else {
            catalog_equal = this.catalog.equal(catalog);
        }
        if (catalog_equal) {
            if (null == this.name) {
                return null == name;
            } else return this.name.equals(name);
        }
        return false;
    }
}
